Skip to content

Add null-safe operator to Data::getProvider()#466

Open
maltehuebner wants to merge 1 commit intomainfrom
fix/data-get-provider-null-check
Open

Add null-safe operator to Data::getProvider()#466
maltehuebner wants to merge 1 commit intomainfrom
fix/data-get-provider-null-check

Conversation

@maltehuebner
Copy link
Contributor

Summary

  • Use nullsafe operator (?->) in Data::getProvider() to prevent TypeError

Problem

Data::station is typed as ?Station (nullable), but getProvider() called $this->station->getProvider() directly. This crashes when station is null, e.g. for adhoc Data objects created by AdhocDataRetriever.

Test plan

  • Verify pages rendering Data objects without stations don't crash
  • Verify station detail pages still show the provider

🤖 Generated with Claude Code

The station property is nullable, but getProvider() called
\$this->station->getProvider() without a null check. This could cause
a TypeError for adhoc Data objects created without a persisted station.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant